<?php

use yii\db\Migration;

/**
 * Class m180104_014031_add_column_type2
 */
class m180104_014031_add_column_type2 extends Migration
{
    /**
     * @inheritdoc
     */
    public function safeUp()
    {
        /*项目表中的type 为显示标记 及新建type2 为项目类型 1保证类、2抵押类、3混合类 默认为0*/
        $this->addColumn('project','type2',$this->smallInteger()->defaultValue(0)->comment('类型'));
    }

    /**
     * @inheritdoc
     */
    public function safeDown()
    {
        echo "m180104_014031_add_column_type2 cannot be reverted.\n";

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m180104_014031_add_column_type2 cannot be reverted.\n";

        return false;
    }
    */
}
